<template>
  <view class="search">
    <u-search
      @click="handleClick"
      :placeholder="props.placeholder"
      :showAction="false"
      :disabled="props.disabled"
      @change="handleEmit"
      height="28"
    ></u-search>
  </view>
</template>

<!-- 首页标题搜索 -->
<script setup>
const props = defineProps({
  placeholder: {
    default: "请输入商品名称",
  },
  disabled: {
    type: Boolean,
    default: true,
  },
});
const emits = defineEmits(["click", "change", "update:modelValue"]);
const handleClick = () => {
  emits("click");
};
const handleEmit = (val) => {
  emits("change", val);
  emits("update:modelValue", val);
};
</script>

<style lang="scss">
.search {
  padding: 9px 15px;
  // width: 235px;
  background-color: #fff;
}
</style>
